import { defineStore } from "pinia";
import { getOrderList } from "@/services/modules/order";

const useOrderStore = defineStore("order", {
    state: () => ({
        orderList: []
    }),

    actions: {
        // 获取订单列表数据
        async fetchOrderListData(type) { // 接收参数 type
            const res = await getOrderList(type);
            this.orderList = res?.data?.data?.orders || [];
        }
    }
})

export default useOrderStore;